﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using QuanLyGiaoVuDAL.DTO;
using AutoMapper;

namespace QuanLyGiaoVuUI.Models.GiangVienClient
{
    public class DeTaiGiangVienClientViewModel
    {
        public Guid MaDeTai { get; set; }
        public String TenDeTai { get; set; }
        public Guid GiangVienHD1 { get; set; }
        public Guid GiangVienHD2 { get; set; }
        public int KhoaLuanTotNghiep { get; set; }
        public Guid MaHocKy { get; set; }
        public String MoTa { get; set; }
        public bool DaDuyet { get; set; }
        public bool DatYeucau { get; set; }
        public String GhiChu { get; set; }

        public GiangVienDTO GiangVien1 { get; set; }
        public GiangVienDTO GiangVien2 { get; set; }
        public IEnumerable<DeTaiDTO> deTaiGiangVien { get; set; }
        public NamHocDTO namHoc { get; set; }

        public DeTaiDTO ToDetaiDTO()
        {
            Mapper.CreateMap(typeof(DeTaiGiangVienClientViewModel), typeof(DeTaiDTO));
            DeTaiDTO deTaiDTO = new DeTaiDTO();
            Mapper.Map(this, deTaiDTO);
            return deTaiDTO;
        }

        public DeTaiGiangVienClientViewModel FromDeTaiDTO(DeTaiDTO deTaiDTO)
        {
            Mapper.CreateMap(typeof(DeTaiDTO), typeof(DeTaiGiangVienClientViewModel));
            DeTaiGiangVienClientViewModel model = new DeTaiGiangVienClientViewModel();
            Mapper.Map(deTaiDTO, model);
            return model;
        }
    }
}